package day04.practise;

import java.util.Random;
import java.util.Scanner;

public class GuessNum {
    public static void main(String[] args) {
        Scanner scanner=new Scanner(System.in);
        Random random=new Random();
        int num=random.nextInt(1000)+1;
        System.out.println(num);
        System.out.println("猜的数:");
        int guessNum=scanner.nextInt();
        while (num!=guessNum){
            if (guessNum>num){
                System.out.println("猜大了");
            }else {
                System.out.println("猜小了");
            }
            guessNum=scanner.nextInt();
        }
        System.out.println("猜对了");
    }
}
